package com.briup.day09.bean;

public class Dog extends Animal {
    private String name;
    private int age = 10;

    public String getName() {
        return name;
    }

    //alt+ins快速生成构造方法
    public void setName(String name) {
        this.name = name;
    }

    public void show() {
//        System.out.println("颜色: "+color);//不可以直接操作父类的私有成员
        System.out.println("年龄: " + age);
        System.out.println("名字: " + name);
    }

    public void memberAccess(int age) {
        System.out.println("age: " + age);
        System.out.println("this.age: " + this.age);
        System.out.println("super.age: " + super.age);
    }

    public void memberAccess() {
        System.out.println("age: " + age);
        System.out.println("this.age: " + this.age);
        System.out.println("super.age: " + super.age);
    }
}
